export default {
	async getProgressList(params) {
		// "createTime": "string",
		//   "estateId": "string",
		//   "images": "string",
		//   "partId": "string",
		//   "photographer": "string",
		//   "progressId": "string",
		//   "progressStatus": 0,
		//   "progressValue": 0,
		//   "queryEndTime": "string",
		//   "queryStartTime": "string",
		//   "rootPartId": "string"
		console.log(params)
		let _push_form = {}
		// _push_form.partId = params.partId
		_push_form.estateId = params.estateId
		_push_form.rootPartId = params.rootPartId
		_push_form.progressStatus = params.progressStatus
		const data = await uni.$H.post('/progress/getProgressList', _push_form, {
			authCode: true
		})
		if (data.status !== 0) {
			uni.$showMsg(data.message)
			return []
		} else {
			return data.body
		}
	},
	async getProgressSum(params) {
		console.log(params)
		let _push_form = {}
		_push_form.estateId = params.estateId
		_push_form.rootPartId = params.rootPartId
		const data = await uni.$H.get('/progress/getProgressSum', _push_form, {
			authCode: true
		})
		if (data.status !== 0) {
			return uni.$showMsg(data.message)
		} else {
			return data.body
		}
	},
	async getProgress(id) {
		// /progress/getProgress
		const data = await uni.$H.post('/progress/getProgress', {
			progressId: id
		}, {
			authCode: true
		})
		if (data.status !== 0) {
			uni.$showMsg(data.message)
			return {}
		} else {
			return data.body
		}
	},
	async deleteProgress(id) {
		const data = await uni.$H.post('/progress/deleteProgress', {
			progressId: id
		}, {
			authCode: true
		})
		if (data.status !== 0) {
			uni.$showMsg(data.message)
			return false
		} else {
			return true
		}
	}
}
